package com.yyfax.pay.depository.vo;

import com.yyfax.pay.common.enums.FuiouDepositStateEnum;
import com.yyfax.pay.common.exception.PayExceptionCode;
import com.yyfax.pay.depository.domain.FuiouWithdrawModifyCash;

/**
 * 富友修改提现方式快照类
 * 
 * @author buyi
 * @date 2017-11-28 15:47:46
 * @since v2.0.0
 */
public class FuiouWithdrawModifyCashVO {

	private FuiouWithdrawModifyCash po;

	private FuiouWithdrawModifyCashVO(FuiouWithdrawModifyCash po) {
		this.po = po;
	}

	/**
	 * 新建一个实例
	 * 
	 * @author buyi
	 * @date 2017-11-28 15:47:30
	 * @since v2.0.0
	 * @param po
	 * @return
	 */
	public static FuiouWithdrawModifyCashVO newInstance(FuiouWithdrawModifyCash po) {
		if (po == null) {
			throw PayExceptionCode.ERROR_ILL_PARAMETER.exp("参数po不能为空");
		}

		return new FuiouWithdrawModifyCashVO(po);
	}

	/**
	 * 判断订单是否已经出结果
	 * 
	 * @author buyi
	 * @date 2017-11-28 15:48:48
	 * @since v2.0.0
	 * @return
	 */
	public boolean isResult() {
		// 如果订单状态成功、失败、受理成功，则已经出结果
		if (FuiouDepositStateEnum.FAIL.isValue(po.getState()) || FuiouDepositStateEnum.SUCCESS.isValue(po.getState())) {
			return true;
		}

		return false;
	}

	public FuiouWithdrawModifyCash getPo() {
		return po;
	}

	public void setPo(FuiouWithdrawModifyCash po) {
		this.po = po;
	}

}
